package com.dm.wallpaper.board;

import com.dm.wallpaper.library.helpers.URLUtil;
import junit.framework.Assert;
import junit.framework.TestCase;

public class UrlUtilTest extends TestCase {


    public void testisAssetUrlNotAsset() {
        boolean isEmpty = URLUtil.isAssetUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisAssetUrlIsAssset() {
        boolean isEmpty = URLUtil.isAssetUrl("file:///ohos_asset/test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisAssetUrlIsEmpty() {
        boolean isEmpty = URLUtil.isAssetUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }


    public void testisResourceUrlNotResource() {
        boolean isEmpty = URLUtil.isResourceUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisResourceUrlIsResource() {
        boolean isEmpty = URLUtil.isResourceUrl("file:///ohos_res/test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisResourceUrlIsEmpty() {
        boolean isEmpty = URLUtil.isResourceUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }


    public void testisFileUrlNotFile() {
        boolean isEmpty = URLUtil.isFileUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisFileUrlIsFilebase() {
        boolean isEmpty = URLUtil.isFileUrl("file:");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisFileUrlIsAssetBase() {
        boolean isEmpty = URLUtil.isFileUrl("file:///ohos_asset/");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisFileUrlIsProxyBase() {
        boolean isEmpty = URLUtil.isFileUrl("file:///cookieless_proxy/");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisFileUrlIsEmpty() {
        boolean isEmpty = URLUtil.isFileUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }


    public void testisAboutUrlNotAbout() {
        boolean isEmpty = URLUtil.isAboutUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisAboutUrlIsAbout() {
        boolean isEmpty = URLUtil.isAboutUrl("about:test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisAboutUrlIsEmpty() {
        boolean isEmpty = URLUtil.isAboutUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisDataUrlNotdata() {
        boolean isEmpty = URLUtil.isDataUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisDataUrlIsdata() {
        boolean isEmpty = URLUtil.isDataUrl("data:test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisDataUrlIsEmpty() {
        boolean isEmpty = URLUtil.isDataUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }


    public void testisJavaScriptUrlNotJavaScript() {
        boolean isEmpty = URLUtil.isJavaScriptUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisJavaScriptUrlIsJavaScript() {
        boolean isEmpty = URLUtil.isJavaScriptUrl("javascript::test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisJavaScriptUrlIsEmpty() {
        boolean isEmpty = URLUtil.isJavaScriptUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpUrlNotJavaScript() {
        boolean isEmpty = URLUtil.isAboutUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpUrlNotJavaScript2() {
        boolean isEmpty = URLUtil.isAboutUrl("123qwqeqeqe");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpUrlIsJavaScript() {
        boolean isEmpty = URLUtil.isHttpUrl("http://test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisHttpUrlIsEmpty() {
        boolean isEmpty = URLUtil.isHttpUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpsUrlNotJavaScript1() {
        boolean isEmpty = URLUtil.isHttpUrl("123");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpsUrlNotJavaScript2() {
        boolean isEmpty = URLUtil.isHttpsUrl("123qwqeqeqe");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisHttpsUrlIsJavaScript() {
        boolean isEmpty = URLUtil.isHttpsUrl("https://test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisHttpsUrlIsEmpty() {
        boolean isEmpty = URLUtil.isHttpsUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisContentUrlNotJavaScript2() {
        boolean isEmpty = URLUtil.isContentUrl("123qwqeqeqe");
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }

    public void testisContentUrlIsContent() {
        boolean isEmpty = URLUtil.isContentUrl("content:test");
        Assert.assertNotNull(isEmpty);
        assertEquals(true, isEmpty);
    }

    public void testisContentUrlIsEmpty() {
        boolean isEmpty = URLUtil.isContentUrl(null);
        Assert.assertNotNull(isEmpty);
        assertEquals(false, isEmpty);
    }


}
